	
<?php
$textlengh = 150;
if(isset($_POST['lastid']))
{
	$lastid=$_POST['lastid'];
	$search=$_POST['searchword'];
	echo "<script>alert('Please enter product name');</script>";
	$result=mysql_query("SELECT * FROM tbl_product WHERE pro_name LIKE '%$search%' and id<'$lastid' LIMIT 3");
	while($row=mysql_fetch_assoc($result))
	{
		extract($row);
?>
				<li class="product_grid">		
                    <div class="product_item image">
                        <div id="<?php echo $pro_id; ?>  class="last_product">
                            <div class="column grid_twelve">
                                <div class="zenimage firstitem">
                                    <a href="index.php?mod=product&act=detail&id=<?php echo $id; ?>"><img src="<?php if($pro_img != ""){ echo $pro_img;} else { echo "images/not_available.jpg";} ?>" style="opacity: 1; "></a>
                                </div>
                                <div class="zentitle">
                                    <h2><a href="index.php?mod=product&act=detail&id=<?php echo $id; ?>"><?php echo $pro_name; ?></a></h2>
                                </div>										
                                <div class="zencategory"><?php echo $pro_cat; ?></div>
                                <div class="zentext element4"><p></p>
                                    <p>
										<?php 
											echo substr($pro_detail, 0, $textlengh);
											echo "...";
										?>
                                    </p>
                                </div>
                                <div class="zenmore">
                                    <a href="index.php?mod=product&act=detail&id=<?php echo $id; ?>"><span class="readon">More ...</span></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </li>
 			

<?php
	}
?>

<div id="more<?php echo $id; ?>" class="morebox">
	<a href="#" id="<?php echo $id; ?>" class="more">more</a>
</div>

<?php
}
?>
				